#ifndef _main__h
#define __main_h
//HAL--------------------

//Const--------------------
#define D_1s 250    //1s
#define D_40ms 9    //40ms
#define D_300ms 75  //300ms
#define D_500ms 124 //500ms
#define D_1m 60
#define D_10s 10
#define D_5s 5

#define    K_BanDan             1
#define K_YuYue              2
#define K_TiaoJie                 3
#define K_ChuShuiDuanDian     4  
#define K_ZiDongGuanJi           5
#define K_KaiGuan                 6

//Var----------------------
#ifdef MAIN_C
uint8_t data timer1s;
uint8_t data timer40ms;
uint8_t data timer300ms;
uint8_t data timer500ms;
uint8_t data timer1m;
uint8_t data keyValue;
uint8_t data longKeyHoldTime;
uint8_t data longKeyValue;
uint8_t data holdKey;
uint8_t data longKeyJudgeTime;
uint8_t data holdKeyValue;
bit data b500ms;
bit  data  bStart;
uint8_t  data  function;
bit  data  bPowerOnOff;
uint8_t timer5s;
bit b5s;
bit bDoubleBuzz;
uint8_t a;
uint8_t b;
#else
extern uint8_t a;
extern uint8_t b;
extern bit bDoubleBuzz;
extern uint8_t data timer1s;
extern uint8_t data timer40ms;
extern uint8_t data timer300ms;
extern uint8_t data timer500ms;
extern uint8_t data timer1m;
extern uint8_t data keyValue;
extern uint8_t data longKeyHoldTime;
extern uint8_t data longKeyValue;
extern uint8_t data holdKey;
extern uint8_t data longKeyJudgeTime;
extern uint8_t data holdKeyValue;
extern bit data b500ms;
extern bit  data  bStart;
extern uint8_t  data  function;
extern bit  data  bPowerOnOff;
extern uint8_t timer5s;
extern bit b5s;
#endif

//Function----------------------
void remKey();
void		PowerSet();
void		Error();
void timerControl();
void getKey();
void PowerOff();
void KeyBanDan         ();
void KeyYuYue          ();
void KeyTiaoJie        ();
void KeyChuShuiDuanDian();
void KeyZiDongGuanJi   ();
void KeyKaiGuan        ();
void FlashControl();
#endif